<extend name="_layout/main" />

<block name="head">


    <link href="__PUBLIC__/ue/ueditor.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ue/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ue/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ue/lang/zh-cn/zh-cn.js"></script>

</block>


<block name="content">


    <div id="mws-container" class="clearfix">
        <div class="container">


            <div class="mws-panel grid_8">
                <div class="mws-panel-header">
                    <span class="mws-i-24 i-list">商品添加</span>
                </div>
                <div class="mws-panel-body">
                    <form class="mws-form" action="{:U('')}" method="post" enctype="multipart/form-data">
                        <input type="hidden" value="{$row['id']}" name="id"/>
                        <input type="hidden" value="{$row['image']}" name="oldlogo"/>
                        <div class="mws-form-row">
                            <label>商品名称</label>
                            <div class="mws-form-item small">
                                <input name="gname" type="text" class="mws-textinput" value="{$row['gname']}"/>
                            </div>
                        </div>

                        <div class="mws-form-row">
                            <label>商品简介</label>
                            <div class="mws-form-item small">
                                <input name="desc" type="text" class="mws-textinput" value="{$row['desc']}"/>
                            </div>
                        </div>

                        <div class="mws-form-inline">
                            <div class="mws-form-row">
                                <label>商品图片</label>
                                <div class="mws-form-item small">
                                    <input name="image" type="file" class="mws-textinput" value="{$row['image']}"/>
                                </div>
<div style="width: 50%;margin: 0 auto">
                                <img style="width: 300px;" src="{$row['image']}"/></div>
                            </div>
                            <div class="mws-form-row">
                                <label>商品介绍</label>
                                <div class="mws-form-item large">
                                    <textarea rows="100%" cols="100%" name="content" style="height: 250px;" id="cont">{$row.content}</textarea>
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>商品分类</label>
                                <div class="mws-form-item small">
                                    <select name="gcats">
                                        <volist name="datas" id="data">
<option value="{$data['id']}" <if condition="$data['id'] eq $row['gcats']">selected="selected" </if>> {:str_repeat('-',$data['level']*5)}{$data.cname}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>

                            <div class="mws-form-row">
                                <label>商品品牌</label>
                                <div class="mws-form-item small">
                                    <select name="brand_id">
                                        <volist name="bdatas" id="data">
                                            <option value="{$data['id']}"> {:str_repeat('-',$data['level']*5)}{$data.bname}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>

                            <div class="mws-form-row">
                                <label>商品库存量</label>
                                <div class="mws-form-item small">
                                    <input name="number" type="text" class="mws-textinput" value="{$row['number']}"/>
                                </div>
                            </div>

                            <div class="mws-form-row">
                                <label>商品价格</label>
                                <div class="mws-form-item small">
                                    <input name="price" type="text" class="mws-textinput" value="{$row['price']}"/>
                                </div>
                            </div>


                            <div class="mws-form-row">
                                <label>商品状态</label>
                                <div class="mws-form-item clearfix">
                                    <ul class="mws-form-list inline">
                                        <li><input type="radio" id="r4" value="0" name="status"> <label for="r4">关闭</label></li>
                                        <li><input type="radio" id="r5" value="1" name="status" checked="checked"> <label for="r5">开启</label></li>
                                    </ul>
                                </div>
                            </div>

                            <div class="mws-form-row">
                                <label>分类排序</label>
                                <div class="mws-form-item small">
                                    <input name="sort" type="text" class="mws-textinput" value="{$row['sort']}" />
                                </div>
                            </div>
                        </div>
                        <div class="mws-button-row">
                            <input type="submit" value="Submit" class="mws-button green" />
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div id="mws-footer">
            Copyright &copy; 2014.Company name All rights reserved.<a target="_blank" href="http://www.17sucai.com/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a>
        </div>

    </div>

</block>


<block name="footer">

    <script type="text/javascript">

        var ue = UE.getEditor('cont', {
            toolbars: [
                ['fullscreen', 'source', 'undo', 'redo', 'bold','simpleupload','fontsize']
            ],
            autoHeightEnabled: true,
            autoFloatEnabled: true
        });



    </script>

</block>